package com.truyen.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.truyen.persistence.dao.LoaiTruyenTranhDao;
import com.truyen.persistence.entity.LoaiTruyenTranh;
import com.truyen.service.LoaiTruyenTranhService;
import com.truyen.utils.PagingInfo;


@Service
public class LoaiTruyenTranhServiceImpl implements LoaiTruyenTranhService {
	
	@Autowired
	private LoaiTruyenTranhDao loaiTruyenTranhDao;

	@Override
	public void save(LoaiTruyenTranh entity) {
		loaiTruyenTranhDao.save(entity);
	}

	@Override
	public LoaiTruyenTranh findById(Long id) {
		return loaiTruyenTranhDao.findById(id);
	}

	@Override
	public List<LoaiTruyenTranh> getAll() {
		return loaiTruyenTranhDao.findAll();
	}

	@Override
	public LoaiTruyenTranh findByProperty(String column, Object value) {
		List<LoaiTruyenTranh> lst = loaiTruyenTranhDao.findByProperty(column, value);
		return (lst.size()>0)?lst.get(0):null;
	}

	@Override
	public List<LoaiTruyenTranh> getAllLst(String kwSearch, String sort, String sortBy,
			PagingInfo pInfo) {
		return loaiTruyenTranhDao.getAllLst(kwSearch,sort,sortBy,pInfo);
	}

	@Override
	public List<LoaiTruyenTranh> getLstAllWithPagingInfo(PagingInfo pInfo) {
		return loaiTruyenTranhDao.getLstAllWithPagingInfo(pInfo);
	}


}
